package cn.lijida.weiwei.favor.modules.member.entity;

import java.io.Serializable;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.TableId;

import cn.lijida.weiwei.favor.commons.validator.AddGroup;
import cn.lijida.weiwei.favor.commons.validator.UpdateGroup;
import cn.lijida.weiwei.favor.commons.validator.annotate.Mobile;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 成员
 * </p>
 *
 * @author jobob
 * @since 2019-12-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class FavorMember implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId
    @NotNull(message = "成员编号不能为空", groups = UpdateGroup.class)
    private Long memberId;

    /**
     * 名称
     */
    @NotBlank(message = "成员名不能为空", groups = AddGroup.class)
    @Pattern(regexp = "^[\u4E00-\u9FA5A-Za-z0-9_]+$", message = "用户名只能包含字符、数字和下划线", groups = AddGroup.class)
    private String memberName;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空", groups = AddGroup.class)
    @Mobile(message = "手机号格式不正确", groups = AddGroup.class)
    private String memberPhone;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = AddGroup.class)
    @Length(min = 6, max = 18, message = "密码长度超过限制", groups = AddGroup.class)
    @Pattern(regexp = "((?=.*\\d)(?=.*\\D)|(?=.*[a-zA-Z])(?=.*[^a-zA-Z]))(?!^.*[\\u4E00-\\u9FA5].*$)^\\S{6,20}$", message = "密码强度过低，数字字母特殊符号至少包含两种", groups = AddGroup.class)
    private String memberPassword;

    /**
     * 盐
     */
    private String memberSalt;

    /**
     * 成员邮箱
     */
    private String memberEmail;

    /**
     * 删除标记
     */
    private Boolean delFlag;

    /**
     * 0启用1禁用
     */
    private Boolean memberStatus;
}
